package step

import _interface "adam2/internal/quant/interface"

// 准备数据步骤
type PrepareDataStep struct {
	prepareData    *_interface.PrepareData
	statisticsDate *_interface.StatisticsDate
}

// 设置PrepareDataStep
func (p *PrepareDataStep) Init(prepareData *_interface.PrepareData, statisticsDate *_interface.StatisticsDate) {
	p.prepareData = prepareData
	p.statisticsDate = statisticsDate
}

// 执行
func (p *PrepareDataStep) Exec(transactionDate string) {
	if (*p.statisticsDate).IsStatisticsDate(transactionDate) {
		(*p.prepareData).DoPrepareData(transactionDate)
	}
}
